//
//  MCReverseHorizontalButton.swift
//  WisdomSpace
//
//  Created by MC on 2018/7/31.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

// 左文字 右图片
class MCReverseHorizontalButton: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.MCGray_light
        self.layer.cornerRadius = 4
        self.layer.masksToBounds = true
        setUpSubViews()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func setUpSubViews() {
        
        self.addSubview(nameLabel)
        nameLabel.snp.updateConstraints { (make) -> Void in
            make.centerY.equalTo(self)
            make.left.equalTo(self).offset(15)
        }
        
        self.addSubview(iconImageView)
        iconImageView.snp.updateConstraints { (make) -> Void in
            make.centerY.equalTo(self)
            make.right.equalTo(self).offset(-15)
        }
        
        
    }
    
    public lazy var iconImageView: UIImageView = {
        let iconImageView = UIImageView.init()
        
        return iconImageView
    }()
    
    public lazy var nameLabel: UILabel = {
        let nameLabel = UILabel.init()
        nameLabel.font = MCFont(12)
        nameLabel.textColor = UIColor.MCBlack
        
        return nameLabel
    }()
}
